import { useState } from 'react';

/**
 * @author liyuan
 * @date 06-06 16:50:50
 * @desc 权限验证
 */
const useAuth = () => {
  const [allAuth, setAllAuth] = useState([]);
  const isAuth = (auth: string) => {
    return allAuth.includes(auth);
  };
  return {
    /**
     * @author liyuan
     * @date 06-06 16:51:01
     * @desc 权限验证,是否存在权限
     */
    isAuth,
    /**
     * @author liyuan
     * @date 06-06 16:51:32
     * @desc 设置用户存在的所有权限
     */
    setAllAuth,
  };
};
export default useAuth;
